<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
	<head>
		<title>Tables</title>
<link href="../docs-assets/Breadcrumbs.css" rel="stylesheet" rev="stylesheet" type="text/css">
		<meta name="viewport" content="width=device-width initial-scale=1">
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
		<meta http-equiv="Content-Language" content="en-gb">

<link href="../docs-assets/Contents.css" rel="stylesheet" rev="stylesheet" type="text/css">
<link href="../docs-assets/Progress.css" rel="stylesheet" rev="stylesheet" type="text/css">
<link href="../docs-assets/Navigation.css" rel="stylesheet" rev="stylesheet" type="text/css">
<link href="../docs-assets/Fonts.css" rel="stylesheet" rev="stylesheet" type="text/css">
<link href="../docs-assets/Base.css" rel="stylesheet" rev="stylesheet" type="text/css">
<script>
function togglePopup(material_id) {
  var popup = document.getElementById(material_id);
  popup.classList.toggle("show");
}
</script>

<link href="../docs-assets/Popups.css" rel="stylesheet" rev="stylesheet" type="text/css">
<link href="../docs-assets/Colours.css" rel="stylesheet" rev="stylesheet" type="text/css">
		
	</head>
	<body class="commentary-font">
		<nav role="navigation">
		<h1><a href="../index.html"><img src="../docs-assets/Inform.png" height=72> </a></h1>
<ul><li><a href="../index.html">home</a></li>
</ul><h2>Compiler</h2><ul>
<li><a href="../structure.html">structure</a></li>
<li><a href="../inbuildn.html">inbuild</a></li>
<li><a href="../inform7n.html">inform7</a></li>
<li><a href="../intern.html">inter</a></li>
<li><a href="../services.html">services</a></li>
<li><a href="../secrets.html">secrets</a></li>
</ul><h2>Other Tools</h2><ul>
<li><a href="../inblorbn.html">inblorb</a></li>
<li><a href="../inform6.html">inform6</a></li>
<li><a href="../inpolicyn.html">inpolicy</a></li>
</ul><h2>Resources</h2><ul>
<li><a href="../extensions.html">extensions</a></li>
<li><a href="../kits.html">kits</a></li>
</ul><h2>Repository</h2><ul>
<li><a href="https://github.com/ganelson/inform"><img src="../docs-assets/github.png" height=0> github</a></li>
</ul><h2>Related Projects</h2><ul>
<li><a href="https://github.com/ganelson/inweb"><img src="../docs-assets/github.png" height=0> inweb</a></li>
<li><a href="https://github.com/ganelson/intest"><img src="../docs-assets/github.png" height=0> intest</a></li>
</ul>
		</nav>
		<main role="main">
		<!-- Weave of 'Tables' generated by inweb -->
<div class="breadcrumbs">
    <ul class="crumbs"><li><a href="../index.html">Home</a></li><li><a href="../inform7n.html">Inform7</a></li><li><a href="index.html">runtime</a></li><li><a href="index.html#5">Chapter 5: Provision Submodules</a></li><li><b>Tables</b></li></ul></div>
<p class="purpose">To compile the tables submodule for a compilation unit, which contains _table packages containing _table_column_usage subpackages.</p>

<ul class="toc"><li><a href="5-tbl.html#SP1">&#167;1. Compilation data for tables</a></li><li><a href="5-tbl.html#SP2">&#167;2. Compilation of tables</a></li><li><a href="5-tbl.html#SP4">&#167;4. Compilation data for table column usages</a></li><li><a href="5-tbl.html#SP6">&#167;6. Kinds as tables</a></li></ul><hr class="tocbar">

<p class="commentary firstcommentary"><a id="SP1" class="paragraph-anchor"></a><b>&#167;1. Compilation data for tables.</b>Each <span class="extract"><span class="extract-syntax">table</span></span> object contains this data:
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="reserved-syntax">typedef</span><span class="plain-syntax"> </span><span class="reserved-syntax">struct</span><span class="plain-syntax"> </span><span class="reserved-syntax">table_compilation_data</span><span class="plain-syntax"> {</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">struct</span><span class="plain-syntax"> </span><span class="identifier-syntax">package_request</span><span class="plain-syntax"> *</span><span class="identifier-syntax">table_package</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">struct</span><span class="plain-syntax"> </span><span class="identifier-syntax">inter_name</span><span class="plain-syntax"> *</span><span class="identifier-syntax">table_identifier</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">struct</span><span class="plain-syntax"> </span><span class="identifier-syntax">wording</span><span class="plain-syntax"> </span><span class="identifier-syntax">name_for_metadata</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">struct</span><span class="plain-syntax"> </span><span class="identifier-syntax">parse_node</span><span class="plain-syntax"> *</span><span class="identifier-syntax">where_created</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">int</span><span class="plain-syntax"> </span><span class="identifier-syntax">translated</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">struct</span><span class="plain-syntax"> </span><span class="identifier-syntax">text_stream</span><span class="plain-syntax"> *</span><span class="identifier-syntax">translated_name</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">struct</span><span class="plain-syntax"> </span><span class="identifier-syntax">inter_name</span><span class="plain-syntax"> *</span><span class="identifier-syntax">translated_iname</span><span class="plain-syntax">;</span>
<span class="plain-syntax">} </span><span class="reserved-syntax">table_compilation_data</span><span class="plain-syntax">;</span>

<span class="reserved-syntax">table_compilation_data</span><span class="plain-syntax"> </span><span class="function-syntax">RTTables::new_table</span><span class="plain-syntax">(</span><span class="identifier-syntax">parse_node</span><span class="plain-syntax"> *</span><span class="identifier-syntax">PN</span><span class="plain-syntax">, </span><span class="identifier-syntax">table</span><span class="plain-syntax"> *</span><span class="identifier-syntax">t</span><span class="plain-syntax">, </span><span class="identifier-syntax">wording</span><span class="plain-syntax"> </span><span class="identifier-syntax">W</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">table_compilation_data</span><span class="plain-syntax"> </span><span class="identifier-syntax">tcd</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">tcd</span><span class="plain-syntax">.</span><span class="element-syntax">table_package</span><span class="plain-syntax"> = </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">tcd</span><span class="plain-syntax">.</span><span class="element-syntax">table_identifier</span><span class="plain-syntax"> = </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">tcd</span><span class="plain-syntax">.</span><span class="element-syntax">name_for_metadata</span><span class="plain-syntax"> = </span><span class="identifier-syntax">W</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">tcd</span><span class="plain-syntax">.</span><span class="element-syntax">where_created</span><span class="plain-syntax"> = </span><span class="identifier-syntax">PN</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">tcd</span><span class="plain-syntax">.</span><span class="element-syntax">translated</span><span class="plain-syntax"> = </span><span class="identifier-syntax">FALSE</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">tcd</span><span class="plain-syntax">.</span><span class="element-syntax">translated_name</span><span class="plain-syntax"> = </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">tcd</span><span class="plain-syntax">.</span><span class="element-syntax">translated_iname</span><span class="plain-syntax"> = </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">return</span><span class="plain-syntax"> </span><span class="identifier-syntax">tcd</span><span class="plain-syntax">;</span>
<span class="plain-syntax">}</span>

<span class="identifier-syntax">package_request</span><span class="plain-syntax"> *</span><span class="function-syntax">RTTables::package</span><button class="popup" onclick="togglePopup('usagePopup1')"><span class="comment-syntax">?</span><span class="popuptext" id="usagePopup1">Usage of <span class="code-font"><span class="function-syntax">RTTables::package</span></span>:<br/><a href="5-tbl.html#SP2">&#167;2</a>, <a href="5-tbl.html#SP2_3">&#167;2.3</a>, <a href="5-tbl.html#SP5">&#167;5</a></span></button><span class="plain-syntax">(</span><span class="identifier-syntax">table</span><span class="plain-syntax"> *</span><span class="identifier-syntax">t</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">t</span><span class="plain-syntax">-&gt;</span><span class="identifier-syntax">compilation_data</span><span class="plain-syntax">.</span><span class="element-syntax">table_package</span><span class="plain-syntax"> == </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">)</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">t</span><span class="plain-syntax">-&gt;</span><span class="identifier-syntax">compilation_data</span><span class="plain-syntax">.</span><span class="element-syntax">table_package</span><span class="plain-syntax"> =</span>
<span class="plain-syntax">            </span><a href="2-hrr.html#SP19" class="function-link"><span class="function-syntax">Hierarchy::local_package_to</span></a><span class="plain-syntax">(</span><span class="constant-syntax">TABLES_HAP</span><span class="plain-syntax">, </span><span class="identifier-syntax">t</span><span class="plain-syntax">-&gt;</span><span class="identifier-syntax">compilation_data</span><span class="plain-syntax">.</span><span class="element-syntax">where_created</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">return</span><span class="plain-syntax"> </span><span class="identifier-syntax">t</span><span class="plain-syntax">-&gt;</span><span class="identifier-syntax">compilation_data</span><span class="plain-syntax">.</span><span class="element-syntax">table_package</span><span class="plain-syntax">;</span>
<span class="plain-syntax">}</span>

<span class="identifier-syntax">inter_name</span><span class="plain-syntax"> *</span><span class="function-syntax">RTTables::identifier</span><button class="popup" onclick="togglePopup('usagePopup2')"><span class="comment-syntax">?</span><span class="popuptext" id="usagePopup2">Usage of <span class="code-font"><span class="function-syntax">RTTables::identifier</span></span>:<br/><a href="5-tbl.html#SP2">&#167;2</a>, <a href="5-tbl.html#SP2_1_1">&#167;2.1.1</a></span></button><span class="plain-syntax">(</span><span class="identifier-syntax">table</span><span class="plain-syntax"> *</span><span class="identifier-syntax">t</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">t</span><span class="plain-syntax">-&gt;</span><span class="identifier-syntax">compilation_data</span><span class="plain-syntax">.</span><span class="element-syntax">table_identifier</span><span class="plain-syntax"> == </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">)</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">t</span><span class="plain-syntax">-&gt;</span><span class="identifier-syntax">compilation_data</span><span class="plain-syntax">.</span><span class="element-syntax">table_identifier</span><span class="plain-syntax"> =</span>
<span class="plain-syntax">            </span><a href="2-hrr.html#SP12" class="function-link"><span class="function-syntax">Hierarchy::make_iname_in</span></a><span class="plain-syntax">(</span><span class="constant-syntax">TABLE_DATA_HL</span><span class="plain-syntax">, </span><a href="5-tbl.html#SP1" class="function-link"><span class="function-syntax">RTTables::package</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">t</span><span class="plain-syntax">));</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">return</span><span class="plain-syntax"> </span><span class="identifier-syntax">t</span><span class="plain-syntax">-&gt;</span><span class="identifier-syntax">compilation_data</span><span class="plain-syntax">.</span><span class="element-syntax">table_identifier</span><span class="plain-syntax">;</span>
<span class="plain-syntax">}</span>

<span class="identifier-syntax">inter_name</span><span class="plain-syntax"> *</span><span class="function-syntax">RTTables::id_translated</span><button class="popup" onclick="togglePopup('usagePopup3')"><span class="comment-syntax">?</span><span class="popuptext" id="usagePopup3">Usage of <span class="code-font"><span class="function-syntax">RTTables::id_translated</span></span>:<br/><a href="5-tbl.html#SP2">&#167;2</a></span></button><span class="plain-syntax">(</span><span class="identifier-syntax">table</span><span class="plain-syntax"> *</span><span class="identifier-syntax">t</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">Str::len</span><span class="plain-syntax">(</span><span class="identifier-syntax">t</span><span class="plain-syntax">-&gt;</span><span class="identifier-syntax">compilation_data</span><span class="plain-syntax">.</span><span class="element-syntax">translated_name</span><span class="plain-syntax">) == </span><span class="constant-syntax">0</span><span class="plain-syntax">) </span><span class="reserved-syntax">return</span><span class="plain-syntax"> </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">t</span><span class="plain-syntax">-&gt;</span><span class="identifier-syntax">compilation_data</span><span class="plain-syntax">.</span><span class="element-syntax">translated_iname</span><span class="plain-syntax"> == </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">t</span><span class="plain-syntax">-&gt;</span><span class="identifier-syntax">compilation_data</span><span class="plain-syntax">.</span><span class="element-syntax">translated_iname</span><span class="plain-syntax"> = </span><span class="identifier-syntax">InterNames::explicitly_named</span><span class="plain-syntax">(</span>
<span class="plain-syntax">            </span><span class="identifier-syntax">t</span><span class="plain-syntax">-&gt;</span><span class="identifier-syntax">compilation_data</span><span class="plain-syntax">.</span><span class="element-syntax">translated_name</span><span class="plain-syntax">, </span><a href="5-tbl.html#SP1" class="function-link"><span class="function-syntax">RTTables::package</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">t</span><span class="plain-syntax">));</span>
<span class="plain-syntax">        </span><a href="2-hrr.html#SP17" class="function-link"><span class="function-syntax">Hierarchy::make_available</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">t</span><span class="plain-syntax">-&gt;</span><span class="identifier-syntax">compilation_data</span><span class="plain-syntax">.</span><span class="element-syntax">translated_iname</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    }</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">return</span><span class="plain-syntax"> </span><span class="identifier-syntax">t</span><span class="plain-syntax">-&gt;</span><span class="identifier-syntax">compilation_data</span><span class="plain-syntax">.</span><span class="element-syntax">translated_iname</span><span class="plain-syntax">;</span>
<span class="plain-syntax">}</span>

<span class="reserved-syntax">void</span><span class="plain-syntax"> </span><span class="function-syntax">RTTables::translate</span><span class="plain-syntax">(</span><span class="identifier-syntax">table</span><span class="plain-syntax"> *</span><span class="identifier-syntax">t</span><span class="plain-syntax">, </span><span class="identifier-syntax">wording</span><span class="plain-syntax"> </span><span class="identifier-syntax">W</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">t</span><span class="plain-syntax">-&gt;</span><span class="identifier-syntax">compilation_data</span><span class="plain-syntax">.</span><span class="element-syntax">translated</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">StandardProblems::sentence_problem</span><span class="plain-syntax">(</span><span class="identifier-syntax">Task::syntax_tree</span><span class="plain-syntax">(),</span>
<span class="plain-syntax">            </span><span class="identifier-syntax">_p_</span><span class="plain-syntax">(</span><span class="identifier-syntax">PM_TranslatesTableAlready</span><span class="plain-syntax">),</span>
<span class="plain-syntax">            </span><span class="string-syntax">"this table has already been translated"</span><span class="plain-syntax">,</span>
<span class="plain-syntax">            </span><span class="string-syntax">"so there must be some duplication somewhere."</span><span class="plain-syntax">);</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">return</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    }</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">t</span><span class="plain-syntax">-&gt;</span><span class="identifier-syntax">compilation_data</span><span class="plain-syntax">.</span><span class="element-syntax">translated</span><span class="plain-syntax"> = </span><span class="identifier-syntax">TRUE</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">t</span><span class="plain-syntax">-&gt;</span><span class="identifier-syntax">compilation_data</span><span class="plain-syntax">.</span><span class="element-syntax">translated_name</span><span class="plain-syntax"> = </span><span class="identifier-syntax">Str::new</span><span class="plain-syntax">();</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">WRITE_TO</span><span class="plain-syntax">(</span><span class="identifier-syntax">t</span><span class="plain-syntax">-&gt;</span><span class="identifier-syntax">compilation_data</span><span class="plain-syntax">.</span><span class="element-syntax">translated_name</span><span class="plain-syntax">, </span><span class="string-syntax">"%N"</span><span class="plain-syntax">, </span><span class="identifier-syntax">Wordings::first_wn</span><span class="plain-syntax">(</span><span class="identifier-syntax">W</span><span class="plain-syntax">));</span>
<span class="plain-syntax">}</span>
</pre>
<ul class="endnotetexts"><li>The structure table_compilation_data is accessed in 3/uo, 5/act, 5/mlt, 5/tc, 5/dbi, 5/dli, 5/dci, 5/rlb, 5/prp, 5/lp, 5/act2, 5/nap and here.</li></ul>
<p class="commentary firstcommentary"><a id="SP2" class="paragraph-anchor"></a><b>&#167;2. Compilation of tables.</b></p>

<pre class="displayed-code all-displayed-code code-font">
<span class="reserved-syntax">void</span><span class="plain-syntax"> </span><span class="function-syntax">RTTables::compile</span><span class="plain-syntax">(</span><span class="reserved-syntax">void</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">table</span><span class="plain-syntax"> *</span><span class="identifier-syntax">t</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">LOOP_OVER</span><span class="plain-syntax">(</span><span class="identifier-syntax">t</span><span class="plain-syntax">, </span><span class="identifier-syntax">table</span><span class="plain-syntax">)</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">t</span><span class="plain-syntax">-&gt;</span><span class="identifier-syntax">amendment_of</span><span class="plain-syntax"> == </span><span class="identifier-syntax">FALSE</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">            </span><span class="identifier-syntax">text_stream</span><span class="plain-syntax"> *</span><span class="identifier-syntax">desc</span><span class="plain-syntax"> = </span><span class="identifier-syntax">Str::new</span><span class="plain-syntax">();</span>
<span class="plain-syntax">            </span><span class="identifier-syntax">WRITE_TO</span><span class="plain-syntax">(</span><span class="identifier-syntax">desc</span><span class="plain-syntax">, </span><span class="string-syntax">"table '%W'"</span><span class="plain-syntax">, </span><span class="identifier-syntax">t</span><span class="plain-syntax">-&gt;</span><span class="identifier-syntax">compilation_data</span><span class="plain-syntax">.</span><span class="element-syntax">name_for_metadata</span><span class="plain-syntax">);</span>
<span class="plain-syntax">            </span><span class="identifier-syntax">Sequence::queue</span><span class="plain-syntax">(&amp;</span><a href="5-tbl.html#SP2" class="function-link"><span class="function-syntax">RTTables::compilation_agent</span></a><span class="plain-syntax">, </span><span class="identifier-syntax">STORE_POINTER_table</span><span class="plain-syntax">(</span><span class="identifier-syntax">t</span><span class="plain-syntax">), </span><span class="identifier-syntax">desc</span><span class="plain-syntax">);</span>
<span class="plain-syntax">        }</span>
<span class="plain-syntax">}</span>

<span class="reserved-syntax">void</span><span class="plain-syntax"> </span><span class="function-syntax">RTTables::compilation_agent</span><span class="plain-syntax">(</span><span class="identifier-syntax">compilation_subtask</span><span class="plain-syntax"> *</span><span class="identifier-syntax">ct</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">table</span><span class="plain-syntax"> *</span><span class="identifier-syntax">t</span><span class="plain-syntax"> = </span><span class="identifier-syntax">RETRIEVE_POINTER_table</span><span class="plain-syntax">(</span><span class="identifier-syntax">ct</span><span class="plain-syntax">-&gt;</span><span class="identifier-syntax">data</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">current_sentence</span><span class="plain-syntax"> = </span><span class="identifier-syntax">t</span><span class="plain-syntax">-&gt;</span><span class="identifier-syntax">table_created_at</span><span class="plain-syntax">-&gt;</span><span class="identifier-syntax">source_table</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">int</span><span class="plain-syntax"> </span><span class="identifier-syntax">blanks_array_hwm</span><span class="plain-syntax"> = </span><span class="constant-syntax">0</span><span class="plain-syntax">; </span><span class="comment-syntax"> the high water mark of storage used in the blanks array</span>
<span class="plain-syntax">    </span><span class="named-paragraph-container code-font"><a href="5-tbl.html#SP2_1" class="named-paragraph-link"><span class="named-paragraph">Compile the run-time storage for the table</span><span class="named-paragraph-number">2.1</span></a></span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="named-paragraph-container code-font"><a href="5-tbl.html#SP2_3" class="named-paragraph-link"><span class="named-paragraph">Compile metadata for the table</span><span class="named-paragraph-number">2.3</span></a></span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="named-paragraph-container code-font"><a href="5-tbl.html#SP2_2" class="named-paragraph-link"><span class="named-paragraph">Compile the blanks bitmap table</span><span class="named-paragraph-number">2.2</span></a></span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><a href="2-hrr.html#SP23" class="function-link"><span class="function-syntax">Hierarchy::apply_metadata_from_iname</span></a><span class="plain-syntax">(</span><a href="5-tbl.html#SP1" class="function-link"><span class="function-syntax">RTTables::package</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">t</span><span class="plain-syntax">), </span><span class="constant-syntax">TABLE_VALUE_MD_HL</span><span class="plain-syntax">,</span>
<span class="plain-syntax">        </span><a href="5-tbl.html#SP1" class="function-link"><span class="function-syntax">RTTables::identifier</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">t</span><span class="plain-syntax">));</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">t</span><span class="plain-syntax"> == </span><span class="identifier-syntax">TheScore::ranking_table</span><span class="plain-syntax">())</span>
<span class="plain-syntax">        </span><a href="2-hrr.html#SP23" class="function-link"><span class="function-syntax">Hierarchy::apply_metadata_from_number</span></a><span class="plain-syntax">(</span><a href="5-tbl.html#SP1" class="function-link"><span class="function-syntax">RTTables::package</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">t</span><span class="plain-syntax">), </span><span class="constant-syntax">RANKING_TABLE_MD_HL</span><span class="plain-syntax">, </span><span class="constant-syntax">1</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">inter_name</span><span class="plain-syntax"> *</span><span class="identifier-syntax">translated</span><span class="plain-syntax"> = </span><a href="5-tbl.html#SP1" class="function-link"><span class="function-syntax">RTTables::id_translated</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">t</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">translated</span><span class="plain-syntax">) </span><a href="2-emt.html#SP8" class="function-link"><span class="function-syntax">Emit::iname_constant</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">translated</span><span class="plain-syntax">, </span><span class="identifier-syntax">K_value</span><span class="plain-syntax">, </span><a href="5-tbl.html#SP1" class="function-link"><span class="function-syntax">RTTables::identifier</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">t</span><span class="plain-syntax">));</span>
<span class="plain-syntax">}</span>
</pre>
<p class="commentary firstcommentary"><a id="SP2_1" class="paragraph-anchor"></a><b>&#167;2.1. </b><span class="named-paragraph-container code-font"><span class="named-paragraph-defn">Compile the run-time storage for the table</span><span class="named-paragraph-number">2.1</span></span><span class="comment-syntax"> =</span>
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="plain-syntax">    </span><span class="reserved-syntax">int</span><span class="plain-syntax"> </span><span class="identifier-syntax">words_used</span><span class="plain-syntax"> = </span><span class="constant-syntax">0</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">current_sentence</span><span class="plain-syntax"> = </span><span class="identifier-syntax">t</span><span class="plain-syntax">-&gt;</span><span class="identifier-syntax">table_created_at</span><span class="plain-syntax">-&gt;</span><span class="identifier-syntax">source_table</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="named-paragraph-container code-font"><a href="5-tbl.html#SP2_1_1" class="named-paragraph-link"><span class="named-paragraph">Compile the outer table array</span><span class="named-paragraph-number">2.1.1</span></a></span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">t</span><span class="plain-syntax">-&gt;</span><span class="identifier-syntax">approximate_array_space_needed</span><span class="plain-syntax"> = </span><span class="identifier-syntax">words_used</span><span class="plain-syntax">;</span>
</pre>
<ul class="endnotetexts"><li>This code is used in <a href="5-tbl.html#SP2">&#167;2</a>.</li></ul>
<p class="commentary firstcommentary"><a id="SP2_1_1" class="paragraph-anchor"></a><b>&#167;2.1.1. </b>At run time, the data in T is essentially stored as a table of column
tables, one for each column. A column table begins with a word identifying
the table column number (so that two columns both called "price" in
different tables will have the same identifying value heading their column
tables), together with special bits set to indicate that exotic types of
data are stored inside. Thus if T has C columns, the column tables are
found at <span class="extract"><span class="extract-syntax">T--&gt;1</span></span>, <span class="extract"><span class="extract-syntax">T--&gt;2</span></span>, ..., <span class="extract"><span class="extract-syntax">T--&gt;C</span></span>.
</p>

<p class="commentary"><span class="named-paragraph-container code-font"><span class="named-paragraph-defn">Compile the outer table array</span><span class="named-paragraph-number">2.1.1</span></span><span class="comment-syntax"> =</span>
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="plain-syntax">    </span><span class="reserved-syntax">for</span><span class="plain-syntax"> (</span><span class="reserved-syntax">int</span><span class="plain-syntax"> </span><span class="identifier-syntax">j</span><span class="plain-syntax">=0; </span><span class="identifier-syntax">j</span><span class="function-syntax">&lt;t-&gt;</span><span class="identifier-syntax">no_columns</span><span class="plain-syntax">; </span><span class="identifier-syntax">j</span><span class="plain-syntax">++) {</span>
<span class="plain-syntax">        </span><span class="named-paragraph-container code-font"><a href="5-tbl.html#SP2_1_1_1" class="named-paragraph-link"><span class="named-paragraph">Compile the inner table array for column j</span><span class="named-paragraph-number">2.1.1.1</span></a></span><span class="plain-syntax">;</span>
<span class="plain-syntax">    }</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">packaging_state</span><span class="plain-syntax"> </span><span class="identifier-syntax">save</span><span class="plain-syntax"> = </span><a href="2-ea.html#SP2" class="function-link"><span class="function-syntax">EmitArrays::begin_bounded</span></a><span class="plain-syntax">(</span><a href="5-tbl.html#SP1" class="function-link"><span class="function-syntax">RTTables::identifier</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">t</span><span class="plain-syntax">), </span><span class="identifier-syntax">K_value</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">for</span><span class="plain-syntax"> (</span><span class="reserved-syntax">int</span><span class="plain-syntax"> </span><span class="identifier-syntax">j</span><span class="plain-syntax">=0; </span><span class="identifier-syntax">j</span><span class="function-syntax">&lt;t-&gt;</span><span class="identifier-syntax">no_columns</span><span class="plain-syntax">; </span><span class="identifier-syntax">j</span><span class="plain-syntax">++) {</span>
<span class="plain-syntax">        </span><a href="2-ea.html#SP4" class="function-link"><span class="function-syntax">EmitArrays::iname_entry</span></a><span class="plain-syntax">(</span><a href="5-tbl.html#SP5" class="function-link"><span class="function-syntax">RTTables::tcu_iname</span></a><span class="plain-syntax">(&amp;(</span><span class="identifier-syntax">t</span><span class="plain-syntax">-&gt;</span><span class="identifier-syntax">columns</span><span class="plain-syntax">[</span><span class="identifier-syntax">j</span><span class="plain-syntax">])));</span>
<span class="plain-syntax">    }</span>
<span class="plain-syntax">    </span><a href="2-ea.html#SP5" class="function-link"><span class="function-syntax">EmitArrays::end</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">save</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">words_used</span><span class="plain-syntax"> += </span><span class="identifier-syntax">t</span><span class="plain-syntax">-&gt;</span><span class="identifier-syntax">no_columns</span><span class="plain-syntax"> + </span><span class="constant-syntax">1</span><span class="plain-syntax">;</span>
</pre>
<ul class="endnotetexts"><li>This code is used in <a href="5-tbl.html#SP2_1">&#167;2.1</a>.</li></ul>
<p class="commentary firstcommentary"><a id="SP2_1_1_1" class="paragraph-anchor"></a><b>&#167;2.1.1.1. </b>Each column table <span class="extract"><span class="extract-syntax">C</span></span> has its identifying number and bitmap combined in
<span class="extract"><span class="extract-syntax">C--&gt;1</span></span> (the ID occupies the lower bits), a pointer to its blanks storage
in <span class="extract"><span class="extract-syntax">C--&gt;2</span></span>, and its actual data in <span class="extract"><span class="extract-syntax">C--&gt;3</span></span>, <span class="extract"><span class="extract-syntax">C--&gt;4</span></span>, ..., <span class="extract"><span class="extract-syntax">C--&gt;(R+2)</span></span>,
where R is the number of rows.
</p>

<p class="commentary">The contents of a cell are not just its value but also an indication of
whether or not it is formally blank, which often makes it impossible to
store in a single virtual machine word. In those situations we also store
a single bit in the "blanks array" which records whether the cell is blank
or not.
</p>

<p class="commentary"><span class="named-paragraph-container code-font"><span class="named-paragraph-defn">Compile the inner table array for column j</span><span class="named-paragraph-number">2.1.1.1</span></span><span class="comment-syntax"> =</span>
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="plain-syntax">    </span><span class="identifier-syntax">packaging_state</span><span class="plain-syntax"> </span><span class="identifier-syntax">save</span><span class="plain-syntax"> = </span><a href="2-ea.html#SP2" class="function-link"><span class="function-syntax">EmitArrays::begin_bounded</span></a><span class="plain-syntax">(</span><a href="5-tbl.html#SP5" class="function-link"><span class="function-syntax">RTTables::tcu_iname</span></a><span class="plain-syntax">(&amp;(</span><span class="identifier-syntax">t</span><span class="plain-syntax">-&gt;</span><span class="identifier-syntax">columns</span><span class="plain-syntax">[</span><span class="identifier-syntax">j</span><span class="plain-syntax">])), </span><span class="identifier-syntax">K_value</span><span class="plain-syntax">);</span>

<span class="plain-syntax">    </span><span class="identifier-syntax">table_column</span><span class="plain-syntax"> *</span><span class="identifier-syntax">tc</span><span class="plain-syntax"> = </span><span class="identifier-syntax">t</span><span class="plain-syntax">-&gt;</span><span class="identifier-syntax">columns</span><span class="plain-syntax">[</span><span class="identifier-syntax">j</span><span class="plain-syntax">].</span><span class="identifier-syntax">column_identity</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">LOGIF</span><span class="plain-syntax">(</span><span class="identifier-syntax">TABLES</span><span class="plain-syntax">, </span><span class="string-syntax">"Compiling column: $C\n"</span><span class="plain-syntax">, </span><span class="identifier-syntax">tc</span><span class="plain-syntax">);</span>

<span class="plain-syntax">    </span><span class="identifier-syntax">kind</span><span class="plain-syntax"> *</span><span class="identifier-syntax">K</span><span class="plain-syntax"> = </span><span class="identifier-syntax">Tables::Columns::get_kind</span><span class="plain-syntax">(</span><span class="identifier-syntax">tc</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">int</span><span class="plain-syntax"> </span><span class="identifier-syntax">bits</span><span class="plain-syntax"> = </span><span class="constant-syntax">0</span><span class="plain-syntax">; </span><span class="comment-syntax"> bitmap of some properties of the column</span>
<span class="plain-syntax">    </span><span class="named-paragraph-container code-font"><a href="5-tbl.html#SP2_1_1_1_3" class="named-paragraph-link"><span class="named-paragraph">Write the bitmap and blank-offset words</span><span class="named-paragraph-number">2.1.1.1.3</span></a></span><span class="plain-syntax">;</span>

<span class="plain-syntax">    </span><span class="reserved-syntax">int</span><span class="plain-syntax"> </span><span class="identifier-syntax">e</span><span class="plain-syntax"> = </span><span class="constant-syntax">0</span><span class="plain-syntax">; </span><span class="comment-syntax"> which bit we're up to within the current byte of the blanks array</span>

<span class="plain-syntax">    </span><span class="reserved-syntax">for</span><span class="plain-syntax"> (</span><span class="identifier-syntax">parse_node</span><span class="plain-syntax"> *</span><span class="identifier-syntax">cell</span><span class="plain-syntax"> = </span><span class="identifier-syntax">t</span><span class="plain-syntax">-&gt;</span><span class="identifier-syntax">columns</span><span class="plain-syntax">[</span><span class="identifier-syntax">j</span><span class="plain-syntax">].</span><span class="identifier-syntax">entries</span><span class="plain-syntax">-&gt;</span><span class="identifier-syntax">down</span><span class="plain-syntax">; </span><span class="identifier-syntax">cell</span><span class="plain-syntax">; </span><span class="identifier-syntax">cell</span><span class="plain-syntax"> = </span><span class="identifier-syntax">cell</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">next</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">        </span><span class="named-paragraph-container code-font"><a href="5-tbl.html#SP2_1_1_1_4" class="named-paragraph-link"><span class="named-paragraph">Write a cell value for the initial contents of this cell</span><span class="named-paragraph-number">2.1.1.1.4</span></a></span><span class="plain-syntax">;</span>
<span class="plain-syntax">        </span><span class="named-paragraph-container code-font"><a href="5-tbl.html#SP2_1_1_1_1" class="named-paragraph-link"><span class="named-paragraph">Allocate one bit in the blanks array, if needed</span><span class="named-paragraph-number">2.1.1.1.1</span></a></span><span class="plain-syntax">;</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">words_used</span><span class="plain-syntax">++;</span>
<span class="plain-syntax">    }</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">int</span><span class="plain-syntax"> </span><span class="identifier-syntax">blank_count</span><span class="plain-syntax"> = </span><span class="identifier-syntax">t</span><span class="plain-syntax">-&gt;</span><span class="identifier-syntax">blank_rows</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> ((</span><span class="identifier-syntax">blank_count</span><span class="plain-syntax"> == </span><span class="constant-syntax">0</span><span class="plain-syntax">) &amp;&amp; (</span><span class="identifier-syntax">t</span><span class="plain-syntax">-&gt;</span><span class="identifier-syntax">columns</span><span class="plain-syntax">[</span><span class="identifier-syntax">j</span><span class="plain-syntax">].</span><span class="identifier-syntax">entries</span><span class="plain-syntax">-&gt;</span><span class="identifier-syntax">down</span><span class="plain-syntax"> == </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">)) </span><span class="identifier-syntax">blank_count</span><span class="plain-syntax"> = </span><span class="constant-syntax">1</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">for</span><span class="plain-syntax"> (</span><span class="reserved-syntax">int</span><span class="plain-syntax"> </span><span class="identifier-syntax">br</span><span class="plain-syntax"> = </span><span class="constant-syntax">0</span><span class="plain-syntax">; </span><span class="identifier-syntax">br</span><span class="plain-syntax"> &lt; </span><span class="identifier-syntax">blank_count</span><span class="plain-syntax">; </span><span class="identifier-syntax">br</span><span class="plain-syntax">++) {</span>
<span class="plain-syntax">        </span><span class="named-paragraph-container code-font"><a href="5-tbl.html#SP2_1_1_1_5" class="named-paragraph-link"><span class="named-paragraph">Write a cell value for a blank cell</span><span class="named-paragraph-number">2.1.1.1.5</span></a></span><span class="plain-syntax">;</span>
<span class="plain-syntax">        </span><span class="named-paragraph-container code-font"><a href="5-tbl.html#SP2_1_1_1_1" class="named-paragraph-link"><span class="named-paragraph">Allocate one bit in the blanks array, if needed</span><span class="named-paragraph-number">2.1.1.1.1</span></a></span><span class="plain-syntax">;</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">words_used</span><span class="plain-syntax">++;</span>
<span class="plain-syntax">    }</span>
<span class="plain-syntax">    </span><span class="named-paragraph-container code-font"><a href="5-tbl.html#SP2_1_1_1_2" class="named-paragraph-link"><span class="named-paragraph">Pad out the blanks array as needed</span><span class="named-paragraph-number">2.1.1.1.2</span></a></span><span class="plain-syntax">;</span>

<span class="plain-syntax">    </span><a href="2-ea.html#SP5" class="function-link"><span class="function-syntax">EmitArrays::end</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">save</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">LOGIF</span><span class="plain-syntax">(</span><span class="identifier-syntax">TABLES</span><span class="plain-syntax">, </span><span class="string-syntax">"Done column: $C\n"</span><span class="plain-syntax">, </span><span class="identifier-syntax">tc</span><span class="plain-syntax">);</span>
</pre>
<ul class="endnotetexts"><li>This code is used in <a href="5-tbl.html#SP2_1_1">&#167;2.1.1</a>.</li></ul>
<p class="commentary firstcommentary"><a id="SP2_1_1_1_1" class="paragraph-anchor"></a><b>&#167;2.1.1.1.1. </b>In this part of the code we're carefully keeping track of how much blank
array storage we need (perhaps none!), but not compiling it. The sole aim
is to make sure <span class="extract"><span class="extract-syntax">blanks_array_hwm</span></span> has the correct value at the beginning of
each column needing blank bits.
</p>

<p class="commentary"><span class="named-paragraph-container code-font"><span class="named-paragraph-defn">Allocate one bit in the blanks array, if needed</span><span class="named-paragraph-number">2.1.1.1.1</span></span><span class="comment-syntax"> =</span>
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> ((</span><span class="identifier-syntax">bits</span><span class="plain-syntax"> &amp; </span><span class="identifier-syntax">TB_COLUMN_NOBLANKBITS</span><span class="plain-syntax">) == </span><span class="constant-syntax">0</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">e</span><span class="plain-syntax">++; </span><span class="reserved-syntax">if</span><span class="plain-syntax"> ((</span><span class="identifier-syntax">e</span><span class="plain-syntax"> % </span><span class="constant-syntax">8</span><span class="plain-syntax">) == </span><span class="constant-syntax">0</span><span class="plain-syntax">) </span><span class="identifier-syntax">blanks_array_hwm</span><span class="plain-syntax">++;</span>
<span class="plain-syntax">    }</span>
</pre>
<ul class="endnotetexts"><li>This code is used in <a href="5-tbl.html#SP2_1_1_1">&#167;2.1.1.1</a> (twice).</li></ul>
<p class="commentary firstcommentary"><a id="SP2_1_1_1_2" class="paragraph-anchor"></a><b>&#167;2.1.1.1.2. </b><span class="named-paragraph-container code-font"><span class="named-paragraph-defn">Pad out the blanks array as needed</span><span class="named-paragraph-number">2.1.1.1.2</span></span><span class="comment-syntax"> =</span>
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> ((</span><span class="identifier-syntax">bits</span><span class="plain-syntax"> &amp; </span><span class="identifier-syntax">TB_COLUMN_NOBLANKBITS</span><span class="plain-syntax">) == </span><span class="constant-syntax">0</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">if</span><span class="plain-syntax"> ((</span><span class="identifier-syntax">e</span><span class="plain-syntax"> % </span><span class="constant-syntax">8</span><span class="plain-syntax">) != </span><span class="constant-syntax">0</span><span class="plain-syntax">) </span><span class="identifier-syntax">blanks_array_hwm</span><span class="plain-syntax">++; </span><span class="comment-syntax"> pad out a partial byte with zero bits</span>
<span class="plain-syntax">    }</span>
</pre>
<ul class="endnotetexts"><li>This code is used in <a href="5-tbl.html#SP2_1_1_1">&#167;2.1.1.1</a>.</li></ul>
<p class="commentary firstcommentary"><a id="SP2_1_1_1_3" class="paragraph-anchor"></a><b>&#167;2.1.1.1.3. </b>The table column array begins with two words: a bitmap giving some minimal
idea of what can safely be done with values, and then an address within the
blanks bitmap array (if this is needed).
</p>

<p class="commentary">A weakness of this scheme occurs if column ID numbers ever grow large enough
to collide with the bits used here: at present, that would need 412 different
table column names, which is dangerously plausible. We should fix this.
</p>

<p class="commentary">The following flags are also defined in <span class="extract"><span class="extract-syntax">Tables.i6t</span></span> and must agree with
the values given there.
</p>

<pre class="definitions code-font"><span class="definition-keyword">define</span> <span class="identifier-syntax">TB_COLUMN_REAL</span><span class="plain-syntax">          </span><span class="constant-syntax">0x8000</span>
<span class="definition-keyword">define</span> <span class="identifier-syntax">TB_COLUMN_SIGNED</span><span class="plain-syntax">            </span><span class="constant-syntax">0x4000</span>
<span class="definition-keyword">define</span> <span class="identifier-syntax">TB_COLUMN_TOPIC</span><span class="plain-syntax">         </span><span class="constant-syntax">0x2000</span>
<span class="definition-keyword">define</span> <span class="identifier-syntax">TB_COLUMN_DONTSORTME</span><span class="plain-syntax">        </span><span class="constant-syntax">0x1000</span>
<span class="definition-keyword">define</span> <span class="identifier-syntax">TB_COLUMN_NOBLANKBITS</span><span class="plain-syntax">   </span><span class="constant-syntax">0x0800</span>
<span class="definition-keyword">define</span> <span class="identifier-syntax">TB_COLUMN_CANEXCHANGE</span><span class="plain-syntax">   </span><span class="constant-syntax">0x0400</span>
<span class="definition-keyword">define</span> <span class="identifier-syntax">TB_COLUMN_ALLOCATED</span><span class="plain-syntax">     </span><span class="constant-syntax">0x0200</span>
</pre>
<p class="commentary"><span class="named-paragraph-container code-font"><span class="named-paragraph-defn">Write the bitmap and blank-offset words</span><span class="named-paragraph-number">2.1.1.1.3</span></span><span class="comment-syntax"> =</span>
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">Kinds::Behaviour::can_exchange</span><span class="plain-syntax">(</span><span class="identifier-syntax">K</span><span class="plain-syntax">))                    </span><span class="identifier-syntax">bits</span><span class="plain-syntax"> += </span><span class="identifier-syntax">TB_COLUMN_CANEXCHANGE</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> ((</span><span class="identifier-syntax">Kinds::Behaviour::uses_signed_comparisons</span><span class="plain-syntax">(</span><span class="identifier-syntax">K</span><span class="plain-syntax">)) ||</span>
<span class="plain-syntax">         (</span><span class="identifier-syntax">Kinds::FloatingPoint::uses_floating_point</span><span class="plain-syntax">(</span><span class="identifier-syntax">K</span><span class="plain-syntax">)))      </span><span class="identifier-syntax">bits</span><span class="plain-syntax"> += </span><span class="identifier-syntax">TB_COLUMN_SIGNED</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">Kinds::FloatingPoint::uses_floating_point</span><span class="plain-syntax">(</span><span class="identifier-syntax">K</span><span class="plain-syntax">))         </span><span class="identifier-syntax">bits</span><span class="plain-syntax"> += </span><span class="identifier-syntax">TB_COLUMN_REAL</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">Kinds::Behaviour::uses_block_values</span><span class="plain-syntax">(</span><span class="identifier-syntax">K</span><span class="plain-syntax">))               </span><span class="identifier-syntax">bits</span><span class="plain-syntax"> += </span><span class="identifier-syntax">TB_COLUMN_ALLOCATED</span><span class="plain-syntax">;</span>

<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> ((</span><span class="identifier-syntax">K_understanding</span><span class="plain-syntax">) &amp;&amp; (</span><span class="identifier-syntax">Kinds::eq</span><span class="plain-syntax">(</span><span class="identifier-syntax">K</span><span class="plain-syntax">, </span><span class="identifier-syntax">K_understanding</span><span class="plain-syntax">))) </span><span class="identifier-syntax">bits</span><span class="plain-syntax"> = </span><span class="identifier-syntax">TB_COLUMN_TOPIC</span><span class="plain-syntax">;</span>

<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><a href="5-tbl.html#SP3" class="function-link"><span class="function-syntax">RTTables::requires_blanks_bitmap</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">K</span><span class="plain-syntax">) == </span><span class="identifier-syntax">FALSE</span><span class="plain-syntax">)         </span><span class="identifier-syntax">bits</span><span class="plain-syntax"> += </span><span class="identifier-syntax">TB_COLUMN_NOBLANKBITS</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">t</span><span class="plain-syntax">-&gt;</span><span class="identifier-syntax">preserve_row_order_at_run_time</span><span class="plain-syntax">)                    </span><span class="identifier-syntax">bits</span><span class="plain-syntax"> += </span><span class="identifier-syntax">TB_COLUMN_DONTSORTME</span><span class="plain-syntax">;</span>

<span class="plain-syntax">    </span><span class="identifier-syntax">inter_name</span><span class="plain-syntax"> *</span><span class="identifier-syntax">bits_iname</span><span class="plain-syntax"> = </span><a href="2-hrr.html#SP12" class="function-link"><span class="function-syntax">Hierarchy::make_iname_in</span></a><span class="plain-syntax">(</span><span class="constant-syntax">COLUMN_BITS_HL</span><span class="plain-syntax">,</span>
<span class="plain-syntax">        </span><a href="5-tbl.html#SP5" class="function-link"><span class="function-syntax">RTTables::tcu_package</span></a><span class="plain-syntax">(&amp;(</span><span class="identifier-syntax">t</span><span class="plain-syntax">-&gt;</span><span class="identifier-syntax">columns</span><span class="plain-syntax">[</span><span class="identifier-syntax">j</span><span class="plain-syntax">])));</span>
<span class="plain-syntax">    </span><a href="2-emt.html#SP6" class="function-link"><span class="function-syntax">Emit::numeric_constant</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">bits_iname</span><span class="plain-syntax">, (</span><span class="identifier-syntax">inter_ti</span><span class="plain-syntax">) </span><span class="identifier-syntax">bits</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><a href="2-ea.html#SP4" class="function-link"><span class="function-syntax">EmitArrays::iname_entry</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">bits_iname</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">inter_name</span><span class="plain-syntax"> *</span><span class="identifier-syntax">identity_iname</span><span class="plain-syntax"> = </span><a href="2-hrr.html#SP12" class="function-link"><span class="function-syntax">Hierarchy::make_iname_in</span></a><span class="plain-syntax">(</span><span class="constant-syntax">COLUMN_IDENTITY_HL</span><span class="plain-syntax">,</span>
<span class="plain-syntax">        </span><a href="5-tbl.html#SP5" class="function-link"><span class="function-syntax">RTTables::tcu_package</span></a><span class="plain-syntax">(&amp;(</span><span class="identifier-syntax">t</span><span class="plain-syntax">-&gt;</span><span class="identifier-syntax">columns</span><span class="plain-syntax">[</span><span class="identifier-syntax">j</span><span class="plain-syntax">])));</span>
<span class="plain-syntax">    </span><a href="2-emt.html#SP8" class="function-link"><span class="function-syntax">Emit::iname_constant</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">identity_iname</span><span class="plain-syntax">, </span><span class="identifier-syntax">K_value</span><span class="plain-syntax">, </span><a href="5-tc.html#SP1" class="function-link"><span class="function-syntax">RTTableColumns::id_iname</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">tc</span><span class="plain-syntax">));</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">bits</span><span class="plain-syntax"> &amp; </span><span class="identifier-syntax">TB_COLUMN_NOBLANKBITS</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">        </span><a href="2-ea.html#SP4" class="function-link"><span class="function-syntax">EmitArrays::null_entry</span></a><span class="plain-syntax">();</span>
<span class="plain-syntax">    } </span><span class="reserved-syntax">else</span><span class="plain-syntax"> {</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">inter_name</span><span class="plain-syntax"> *</span><span class="identifier-syntax">blanks_iname</span><span class="plain-syntax"> = </span><a href="2-hrr.html#SP12" class="function-link"><span class="function-syntax">Hierarchy::make_iname_in</span></a><span class="plain-syntax">(</span><span class="constant-syntax">COLUMN_BLANKS_HL</span><span class="plain-syntax">,</span>
<span class="plain-syntax">            </span><a href="5-tbl.html#SP5" class="function-link"><span class="function-syntax">RTTables::tcu_package</span></a><span class="plain-syntax">(&amp;(</span><span class="identifier-syntax">t</span><span class="plain-syntax">-&gt;</span><span class="identifier-syntax">columns</span><span class="plain-syntax">[</span><span class="identifier-syntax">j</span><span class="plain-syntax">])));</span>
<span class="plain-syntax">        </span><a href="2-emt.html#SP6" class="function-link"><span class="function-syntax">Emit::numeric_constant</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">blanks_iname</span><span class="plain-syntax">, (</span><span class="identifier-syntax">inter_ti</span><span class="plain-syntax">) </span><span class="identifier-syntax">blanks_array_hwm</span><span class="plain-syntax">);</span>
<span class="plain-syntax">        </span><a href="2-ea.html#SP4" class="function-link"><span class="function-syntax">EmitArrays::iname_entry</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">blanks_iname</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    }</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">words_used</span><span class="plain-syntax"> += </span><span class="constant-syntax">2</span><span class="plain-syntax">;</span>
</pre>
<ul class="endnotetexts"><li>This code is used in <a href="5-tbl.html#SP2_1_1_1">&#167;2.1.1.1</a>.</li></ul>
<p class="commentary firstcommentary"><a id="SP2_1_1_1_4" class="paragraph-anchor"></a><b>&#167;2.1.1.1.4. </b>The cell can only contain a generic value in the case of column 1 of a table
used to define new kinds; in this case it doesn't matter what we write, but
<span class="extract"><span class="extract-syntax">nothing</span></span> has the virtue of being typesafe.
</p>

<p class="commentary"><span class="named-paragraph-container code-font"><span class="named-paragraph-defn">Write a cell value for the initial contents of this cell</span><span class="named-paragraph-number">2.1.1.1.4</span></span><span class="comment-syntax"> =</span>
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="plain-syntax">    </span><span class="identifier-syntax">current_sentence</span><span class="plain-syntax"> = </span><span class="identifier-syntax">cell</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">Annotations::read_int</span><span class="plain-syntax">(</span><span class="identifier-syntax">cell</span><span class="plain-syntax">, </span><span class="identifier-syntax">table_cell_unspecified_ANNOT</span><span class="plain-syntax">)) {</span>
<span class="plain-syntax">        </span><span class="named-paragraph-container code-font"><a href="5-tbl.html#SP2_1_1_1_5" class="named-paragraph-link"><span class="named-paragraph">Write a cell value for a blank cell</span><span class="named-paragraph-number">2.1.1.1.5</span></a></span><span class="plain-syntax">;</span>
<span class="plain-syntax">    } </span><span class="reserved-syntax">else</span><span class="plain-syntax"> {</span>
<span class="plain-syntax">        #</span><span class="identifier-syntax">ifdef</span><span class="plain-syntax"> </span><span class="identifier-syntax">IF_MODULE</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">bits</span><span class="plain-syntax"> &amp; </span><span class="identifier-syntax">TB_COLUMN_TOPIC</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">            </span><span class="identifier-syntax">wording</span><span class="plain-syntax"> </span><span class="identifier-syntax">W</span><span class="plain-syntax"> = </span><span class="identifier-syntax">Node::get_text</span><span class="plain-syntax">(</span><span class="identifier-syntax">cell</span><span class="plain-syntax">);</span>
<span class="plain-syntax">            </span><a href="2-ea.html#SP4" class="function-link"><span class="function-syntax">EmitArrays::generic_entry</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">CompileRvalues::compile_understanding</span><span class="plain-syntax">(</span><span class="identifier-syntax">W</span><span class="plain-syntax">));</span>
<span class="plain-syntax">        } </span><span class="reserved-syntax">else</span><span class="plain-syntax"> {</span>
<span class="plain-syntax">        #</span><span class="identifier-syntax">endif</span>
<span class="plain-syntax">            </span><span class="identifier-syntax">parse_node</span><span class="plain-syntax"> *</span><span class="identifier-syntax">val</span><span class="plain-syntax"> = </span><span class="identifier-syntax">Node::get_evaluation</span><span class="plain-syntax">(</span><span class="identifier-syntax">cell</span><span class="plain-syntax">);</span>
<span class="plain-syntax">            </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">Specifications::is_kind_like</span><span class="plain-syntax">(</span><span class="identifier-syntax">val</span><span class="plain-syntax">)) </span><a href="2-ea.html#SP4" class="function-link"><span class="function-syntax">EmitArrays::numeric_entry</span></a><span class="plain-syntax">(0);</span>
<span class="plain-syntax">            </span><span class="reserved-syntax">else</span><span class="plain-syntax"> </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">val</span><span class="plain-syntax"> == </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">) </span><span class="identifier-syntax">internal_error</span><span class="plain-syntax">(</span><span class="string-syntax">"Valueless cell"</span><span class="plain-syntax">);</span>
<span class="plain-syntax">            </span><span class="reserved-syntax">else</span><span class="plain-syntax"> </span><span class="identifier-syntax">CompileValues::to_array_entry_of_kind</span><span class="plain-syntax">(</span><span class="identifier-syntax">val</span><span class="plain-syntax">, </span><span class="identifier-syntax">K</span><span class="plain-syntax">);</span>
<span class="plain-syntax">        #</span><span class="identifier-syntax">ifdef</span><span class="plain-syntax"> </span><span class="identifier-syntax">IF_MODULE</span>
<span class="plain-syntax">        }</span>
<span class="plain-syntax">        #</span><span class="identifier-syntax">endif</span>
<span class="plain-syntax">    }</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">words_used</span><span class="plain-syntax">++;</span>
</pre>
<ul class="endnotetexts"><li>This code is used in <a href="5-tbl.html#SP2_1_1_1">&#167;2.1.1.1</a>.</li></ul>
<p class="commentary firstcommentary"><a id="SP2_1_1_1_5" class="paragraph-anchor"></a><b>&#167;2.1.1.1.5. </b>As we've noted, our storage for a cell is both the array value we write here
and also a separate bit in the blanks array. In practice, though, it's inefficient
to look up two parallel structures each time we want to access the cell. So a
blank cell is represented as both the value <span class="extract"><span class="extract-syntax">TABLE_NOVALUE</span></span>, chosen so that it
is very unlikely ever to occur as a genuine table value (currently it's the
picturesque hexadecimal value <span class="extract"><span class="extract-syntax">0xDEADCE11</span></span>), and also as a blank bit set in
the blanks array. This makes a negative check &mdash; that something is not blank
&mdash; very quick, since only in the very rare case when the value does coincide
with <span class="extract"><span class="extract-syntax">TABLE_NOVALUE</span></span> do we need to check the blanks array. A positive check
necessarily takes longer, but this cannot be helped.
</p>

<p class="commentary">With some kinds it is possible to prove that <span class="extract"><span class="extract-syntax">TABLE_NOVALUE</span></span> cannot be a legal
value, and then space in the blanks array isn't needed: this is when the
<span class="extract"><span class="extract-syntax">TB_COLUMN_NOBLANKBITS</span></span> flag is set. These kinds include all enumerated kinds
and also object numbers. (The latter are enumerated in the Z-machine but not
in Glulx: however, <span class="extract"><span class="extract-syntax">TABLE_NOVALUE</span></span> is so large a number that it can never be
an object reference value in any story file smaller than 3.5 GB, and in
practice I6 and I7 are not capable of generating story files above 2 GB in any
case.)
</p>

<p class="commentary"><span class="named-paragraph-container code-font"><span class="named-paragraph-defn">Write a cell value for a blank cell</span><span class="named-paragraph-number">2.1.1.1.5</span></span><span class="comment-syntax"> =</span>
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">t</span><span class="plain-syntax">-&gt;</span><span class="identifier-syntax">fill_in_blanks</span><span class="plain-syntax"> == </span><span class="identifier-syntax">FALSE</span><span class="plain-syntax">) </span><a href="2-ea.html#SP4" class="function-link"><span class="function-syntax">EmitArrays::iname_entry</span></a><span class="plain-syntax">(</span><a href="2-hrr.html#SP11" class="function-link"><span class="function-syntax">Hierarchy::find</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">TABLE_NOVALUE_HL</span><span class="plain-syntax">));</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">else</span><span class="plain-syntax"> </span><a href="2-dv.html#SP1" class="function-link"><span class="function-syntax">DefaultValues::array_entry</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">K</span><span class="plain-syntax">, </span><span class="identifier-syntax">EMPTY_WORDING</span><span class="plain-syntax">, </span><span class="string-syntax">"table entry"</span><span class="plain-syntax">);</span>
</pre>
<ul class="endnotetexts"><li>This code is used in <a href="5-tbl.html#SP2_1_1_1">&#167;2.1.1.1</a> and <a href="5-tbl.html#SP2_1_1_1_4">&#167;2.1.1.1.4</a>.</li></ul>
<p class="commentary firstcommentary"><a id="SP2_2" class="paragraph-anchor"></a><b>&#167;2.2. </b><span class="named-paragraph-container code-font"><span class="named-paragraph-defn">Compile the blanks bitmap table</span><span class="named-paragraph-number">2.2</span></span><span class="comment-syntax"> =</span>
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="plain-syntax">    </span><span class="reserved-syntax">for</span><span class="plain-syntax"> (</span><span class="reserved-syntax">int</span><span class="plain-syntax"> </span><span class="identifier-syntax">j</span><span class="plain-syntax">=0; </span><span class="identifier-syntax">j</span><span class="function-syntax">&lt;t-&gt;</span><span class="identifier-syntax">no_columns</span><span class="plain-syntax">; </span><span class="identifier-syntax">j</span><span class="plain-syntax">++) {</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">table_column</span><span class="plain-syntax"> *</span><span class="identifier-syntax">tc</span><span class="plain-syntax"> = </span><span class="identifier-syntax">t</span><span class="plain-syntax">-&gt;</span><span class="identifier-syntax">columns</span><span class="plain-syntax">[</span><span class="identifier-syntax">j</span><span class="plain-syntax">].</span><span class="identifier-syntax">column_identity</span><span class="plain-syntax">;</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><a href="5-tbl.html#SP3" class="function-link"><span class="function-syntax">RTTables::requires_blanks_bitmap</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">Tables::Columns::get_kind</span><span class="plain-syntax">(</span><span class="identifier-syntax">tc</span><span class="plain-syntax">)) == </span><span class="identifier-syntax">FALSE</span><span class="plain-syntax">)</span>
<span class="plain-syntax">            </span><span class="reserved-syntax">continue</span><span class="plain-syntax">;</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">inter_name</span><span class="plain-syntax"> *</span><span class="identifier-syntax">iname</span><span class="plain-syntax"> = </span><a href="2-hrr.html#SP12" class="function-link"><span class="function-syntax">Hierarchy::make_iname_in</span></a><span class="plain-syntax">(</span><span class="constant-syntax">COLUMN_BLANK_DATA_HL</span><span class="plain-syntax">,</span>
<span class="plain-syntax">            </span><a href="5-tbl.html#SP5" class="function-link"><span class="function-syntax">RTTables::tcu_package</span></a><span class="plain-syntax">(&amp;(</span><span class="identifier-syntax">t</span><span class="plain-syntax">-&gt;</span><span class="identifier-syntax">columns</span><span class="plain-syntax">[</span><span class="identifier-syntax">j</span><span class="plain-syntax">])));</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">packaging_state</span><span class="plain-syntax"> </span><span class="identifier-syntax">save</span><span class="plain-syntax"> = </span><a href="2-ea.html#SP2" class="function-link"><span class="function-syntax">EmitArrays::begin_byte</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">iname</span><span class="plain-syntax">, </span><span class="identifier-syntax">K_number</span><span class="plain-syntax">);</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">int</span><span class="plain-syntax"> </span><span class="identifier-syntax">current_bit</span><span class="plain-syntax"> = </span><span class="constant-syntax">1</span><span class="plain-syntax">, </span><span class="identifier-syntax">byte_so_far</span><span class="plain-syntax"> = </span><span class="constant-syntax">0</span><span class="plain-syntax">;</span>
<span class="plain-syntax">        </span><span class="named-paragraph-container code-font"><a href="5-tbl.html#SP2_2_1" class="named-paragraph-link"><span class="named-paragraph">Compile blank bits for entries from the source text</span><span class="named-paragraph-number">2.2.1</span></a></span><span class="plain-syntax">;</span>
<span class="plain-syntax">        </span><span class="named-paragraph-container code-font"><a href="5-tbl.html#SP2_2_2" class="named-paragraph-link"><span class="named-paragraph">Compile blank bits for additional blank rows</span><span class="named-paragraph-number">2.2.2</span></a></span><span class="plain-syntax">;</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">current_bit</span><span class="plain-syntax"> != </span><span class="constant-syntax">1</span><span class="plain-syntax">) </span><span class="named-paragraph-container code-font"><a href="5-tbl.html#SP2_2_3" class="named-paragraph-link"><span class="named-paragraph">Ship the current byte of the blanks table</span><span class="named-paragraph-number">2.2.3</span></a></span><span class="plain-syntax">;</span>
<span class="plain-syntax">        </span><a href="2-ea.html#SP5" class="function-link"><span class="function-syntax">EmitArrays::end</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">save</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    }</span>
</pre>
<ul class="endnotetexts"><li>This code is used in <a href="5-tbl.html#SP2">&#167;2</a>.</li></ul>
<p class="commentary firstcommentary"><a id="SP2_2_1" class="paragraph-anchor"></a><b>&#167;2.2.1. </b><span class="named-paragraph-container code-font"><span class="named-paragraph-defn">Compile blank bits for entries from the source text</span><span class="named-paragraph-number">2.2.1</span></span><span class="comment-syntax"> =</span>
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="plain-syntax">    </span><span class="identifier-syntax">parse_node</span><span class="plain-syntax"> *</span><span class="identifier-syntax">cell</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">for</span><span class="plain-syntax"> (</span><span class="identifier-syntax">cell</span><span class="plain-syntax"> = </span><span class="identifier-syntax">t</span><span class="plain-syntax">-&gt;</span><span class="identifier-syntax">columns</span><span class="plain-syntax">[</span><span class="identifier-syntax">j</span><span class="plain-syntax">].</span><span class="identifier-syntax">entries</span><span class="plain-syntax">-&gt;</span><span class="identifier-syntax">down</span><span class="plain-syntax">; </span><span class="identifier-syntax">cell</span><span class="plain-syntax">; </span><span class="identifier-syntax">cell</span><span class="plain-syntax"> = </span><span class="identifier-syntax">cell</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">next</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">if</span><span class="plain-syntax"> ((</span><span class="identifier-syntax">Annotations::read_int</span><span class="plain-syntax">(</span><span class="identifier-syntax">cell</span><span class="plain-syntax">, </span><span class="identifier-syntax">table_cell_unspecified_ANNOT</span><span class="plain-syntax">))</span>
<span class="plain-syntax">            &amp;&amp; (</span><span class="identifier-syntax">t</span><span class="plain-syntax">-&gt;</span><span class="identifier-syntax">fill_in_blanks</span><span class="plain-syntax"> == </span><span class="identifier-syntax">FALSE</span><span class="plain-syntax">))</span>
<span class="plain-syntax">            </span><span class="identifier-syntax">byte_so_far</span><span class="plain-syntax"> += </span><span class="identifier-syntax">current_bit</span><span class="plain-syntax">;</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">current_bit</span><span class="plain-syntax"> = </span><span class="identifier-syntax">current_bit</span><span class="plain-syntax">*2;</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">current_bit</span><span class="plain-syntax"> == </span><span class="constant-syntax">256</span><span class="plain-syntax">) </span><span class="named-paragraph-container code-font"><a href="5-tbl.html#SP2_2_3" class="named-paragraph-link"><span class="named-paragraph">Ship the current byte of the blanks table</span><span class="named-paragraph-number">2.2.3</span></a></span><span class="plain-syntax">;</span>
<span class="plain-syntax">    }</span>
</pre>
<ul class="endnotetexts"><li>This code is used in <a href="5-tbl.html#SP2_2">&#167;2.2</a>.</li></ul>
<p class="commentary firstcommentary"><a id="SP2_2_2" class="paragraph-anchor"></a><b>&#167;2.2.2. </b><span class="named-paragraph-container code-font"><span class="named-paragraph-defn">Compile blank bits for additional blank rows</span><span class="named-paragraph-number">2.2.2</span></span><span class="comment-syntax"> =</span>
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="plain-syntax">    </span><span class="reserved-syntax">int</span><span class="plain-syntax"> </span><span class="identifier-syntax">k</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">for</span><span class="plain-syntax"> (</span><span class="identifier-syntax">k</span><span class="plain-syntax"> = </span><span class="constant-syntax">0</span><span class="plain-syntax">; </span><span class="identifier-syntax">k</span><span class="plain-syntax"> &lt; </span><span class="identifier-syntax">t</span><span class="plain-syntax">-&gt;</span><span class="identifier-syntax">blank_rows</span><span class="plain-syntax">; </span><span class="identifier-syntax">k</span><span class="plain-syntax">++) {</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">byte_so_far</span><span class="plain-syntax"> += </span><span class="identifier-syntax">current_bit</span><span class="plain-syntax">;</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">current_bit</span><span class="plain-syntax"> = </span><span class="identifier-syntax">current_bit</span><span class="plain-syntax">*2;</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">current_bit</span><span class="plain-syntax"> == </span><span class="constant-syntax">256</span><span class="plain-syntax">) </span><span class="named-paragraph-container code-font"><a href="5-tbl.html#SP2_2_3" class="named-paragraph-link"><span class="named-paragraph">Ship the current byte of the blanks table</span><span class="named-paragraph-number">2.2.3</span></a></span><span class="plain-syntax">;</span>
<span class="plain-syntax">    }</span>
</pre>
<ul class="endnotetexts"><li>This code is used in <a href="5-tbl.html#SP2_2">&#167;2.2</a>.</li></ul>
<p class="commentary firstcommentary"><a id="SP2_2_3" class="paragraph-anchor"></a><b>&#167;2.2.3. </b><span class="named-paragraph-container code-font"><span class="named-paragraph-defn">Ship the current byte of the blanks table</span><span class="named-paragraph-number">2.2.3</span></span><span class="comment-syntax"> =</span>
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="plain-syntax">    </span><a href="2-ea.html#SP4" class="function-link"><span class="function-syntax">EmitArrays::numeric_entry</span></a><span class="plain-syntax">((</span><span class="identifier-syntax">inter_ti</span><span class="plain-syntax">) </span><span class="identifier-syntax">byte_so_far</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">byte_so_far</span><span class="plain-syntax"> = </span><span class="constant-syntax">0</span><span class="plain-syntax">; </span><span class="identifier-syntax">current_bit</span><span class="plain-syntax"> = </span><span class="constant-syntax">1</span><span class="plain-syntax">;</span>
</pre>
<ul class="endnotetexts"><li>This code is used in <a href="5-tbl.html#SP2_2">&#167;2.2</a>, <a href="5-tbl.html#SP2_2_1">&#167;2.2.1</a> and <a href="5-tbl.html#SP2_2_2">&#167;2.2.2</a>.</li></ul>
<p class="commentary firstcommentary"><a id="SP2_3" class="paragraph-anchor"></a><b>&#167;2.3. </b><span class="named-paragraph-container code-font"><span class="named-paragraph-defn">Compile metadata for the table</span><span class="named-paragraph-number">2.3</span></span><span class="comment-syntax"> =</span>
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="plain-syntax">    </span><a href="2-hrr.html#SP23" class="function-link"><span class="function-syntax">Hierarchy::apply_metadata_from_wording</span></a><span class="plain-syntax">(</span><a href="5-tbl.html#SP1" class="function-link"><span class="function-syntax">RTTables::package</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">t</span><span class="plain-syntax">),</span>
<span class="plain-syntax">        </span><span class="constant-syntax">TABLE_NAME_MD_HL</span><span class="plain-syntax">, </span><span class="identifier-syntax">t</span><span class="plain-syntax">-&gt;</span><span class="identifier-syntax">compilation_data</span><span class="plain-syntax">.</span><span class="element-syntax">name_for_metadata</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">inter_name</span><span class="plain-syntax"> *</span><span class="identifier-syntax">iname</span><span class="plain-syntax"> = </span><a href="2-hrr.html#SP12" class="function-link"><span class="function-syntax">Hierarchy::make_iname_in</span></a><span class="plain-syntax">(</span><span class="constant-syntax">TABLE_ID_HL</span><span class="plain-syntax">, </span><a href="5-tbl.html#SP1" class="function-link"><span class="function-syntax">RTTables::package</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">t</span><span class="plain-syntax">));</span>
<span class="plain-syntax">    </span><a href="2-emt.html#SP6" class="function-link"><span class="function-syntax">Emit::numeric_constant</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">iname</span><span class="plain-syntax">, </span><span class="constant-syntax">0</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">TEMPORARY_TEXT</span><span class="plain-syntax">(</span><span class="identifier-syntax">S</span><span class="plain-syntax">)</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">WRITE_TO</span><span class="plain-syntax">(</span><span class="identifier-syntax">S</span><span class="plain-syntax">, </span><span class="string-syntax">"%+W"</span><span class="plain-syntax">, </span><span class="identifier-syntax">Node::get_text</span><span class="plain-syntax">(</span><span class="identifier-syntax">t</span><span class="plain-syntax">-&gt;</span><span class="identifier-syntax">headline_fragment</span><span class="plain-syntax">));</span>
<span class="plain-syntax">    </span><a href="2-hrr.html#SP23" class="function-link"><span class="function-syntax">Hierarchy::apply_metadata</span></a><span class="plain-syntax">(</span><a href="5-tbl.html#SP1" class="function-link"><span class="function-syntax">RTTables::package</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">t</span><span class="plain-syntax">), </span><span class="constant-syntax">TABLE_PNAME_MD_HL</span><span class="plain-syntax">, </span><span class="identifier-syntax">S</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">DISCARD_TEXT</span><span class="plain-syntax">(</span><span class="identifier-syntax">S</span><span class="plain-syntax">)</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">for</span><span class="plain-syntax"> (</span><span class="identifier-syntax">table_contribution</span><span class="plain-syntax"> *</span><span class="identifier-syntax">tc</span><span class="plain-syntax"> = </span><span class="identifier-syntax">t</span><span class="plain-syntax">-&gt;</span><span class="identifier-syntax">table_created_at</span><span class="plain-syntax">; </span><span class="identifier-syntax">tc</span><span class="plain-syntax">; </span><span class="identifier-syntax">tc</span><span class="plain-syntax"> = </span><span class="identifier-syntax">tc</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">next</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">package_request</span><span class="plain-syntax"> *</span><span class="identifier-syntax">R</span><span class="plain-syntax"> =</span>
<span class="plain-syntax">            </span><a href="2-hrr.html#SP21" class="function-link"><span class="function-syntax">Hierarchy::package_within</span></a><span class="plain-syntax">(</span><span class="constant-syntax">TABLE_CONTRIBUTION_HAP</span><span class="plain-syntax">,</span>
<span class="plain-syntax">                </span><a href="5-tbl.html#SP1" class="function-link"><span class="function-syntax">RTTables::package</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">t</span><span class="plain-syntax">));</span>
<span class="plain-syntax">        </span><a href="2-hrr.html#SP23" class="function-link"><span class="function-syntax">Hierarchy::apply_metadata_from_number</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">R</span><span class="plain-syntax">, </span><span class="constant-syntax">TABLE_CONTRIBUTION_AT_MD_HL</span><span class="plain-syntax">,</span>
<span class="plain-syntax">            (</span><span class="identifier-syntax">inter_ti</span><span class="plain-syntax">) </span><span class="identifier-syntax">Wordings::first_wn</span><span class="plain-syntax">(</span><span class="identifier-syntax">Node::get_text</span><span class="plain-syntax">(</span><span class="identifier-syntax">tc</span><span class="plain-syntax">-&gt;</span><span class="identifier-syntax">source_table</span><span class="plain-syntax">)));</span>
<span class="plain-syntax">    }</span>
<span class="plain-syntax">    </span><a href="2-hrr.html#SP23" class="function-link"><span class="function-syntax">Hierarchy::apply_metadata_from_number</span></a><span class="plain-syntax">(</span><a href="5-tbl.html#SP1" class="function-link"><span class="function-syntax">RTTables::package</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">t</span><span class="plain-syntax">),</span>
<span class="plain-syntax">        </span><span class="constant-syntax">TABLE_ROWS_MD_HL</span><span class="plain-syntax">, (</span><span class="identifier-syntax">inter_ti</span><span class="plain-syntax">) </span><span class="identifier-syntax">Tables::get_no_rows</span><span class="plain-syntax">(</span><span class="identifier-syntax">t</span><span class="plain-syntax">));</span>
<span class="plain-syntax">    </span><a href="2-hrr.html#SP23" class="function-link"><span class="function-syntax">Hierarchy::apply_metadata_from_number</span></a><span class="plain-syntax">(</span><a href="5-tbl.html#SP1" class="function-link"><span class="function-syntax">RTTables::package</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">t</span><span class="plain-syntax">),</span>
<span class="plain-syntax">        </span><span class="constant-syntax">TABLE_BLANK_ROWS_MD_HL</span><span class="plain-syntax">, (</span><span class="identifier-syntax">inter_ti</span><span class="plain-syntax">) </span><span class="identifier-syntax">t</span><span class="plain-syntax">-&gt;</span><span class="identifier-syntax">blank_rows</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">Wordings::nonempty</span><span class="plain-syntax">(</span><span class="identifier-syntax">t</span><span class="plain-syntax">-&gt;</span><span class="identifier-syntax">blank_rows_for_each_text</span><span class="plain-syntax">))</span>
<span class="plain-syntax">        </span><a href="2-hrr.html#SP23" class="function-link"><span class="function-syntax">Hierarchy::apply_metadata_from_raw_wording</span></a><span class="plain-syntax">(</span><a href="5-tbl.html#SP1" class="function-link"><span class="function-syntax">RTTables::package</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">t</span><span class="plain-syntax">),</span>
<span class="plain-syntax">            </span><span class="constant-syntax">TABLE_BLANK_ROWS_FOR_MD_HL</span><span class="plain-syntax">, </span><span class="identifier-syntax">t</span><span class="plain-syntax">-&gt;</span><span class="identifier-syntax">blank_rows_for_each_text</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">t</span><span class="plain-syntax">-&gt;</span><span class="identifier-syntax">first_column_by_definition</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">        </span><a href="2-hrr.html#SP23" class="function-link"><span class="function-syntax">Hierarchy::apply_metadata_from_number</span></a><span class="plain-syntax">(</span><a href="5-tbl.html#SP1" class="function-link"><span class="function-syntax">RTTables::package</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">t</span><span class="plain-syntax">),</span>
<span class="plain-syntax">            </span><span class="constant-syntax">TABLE_DEFINES_MD_HL</span><span class="plain-syntax">, </span><span class="constant-syntax">1</span><span class="plain-syntax">);</span>
<span class="plain-syntax">        </span><a href="2-hrr.html#SP23" class="function-link"><span class="function-syntax">Hierarchy::apply_metadata_from_raw_wording</span></a><span class="plain-syntax">(</span><a href="5-tbl.html#SP1" class="function-link"><span class="function-syntax">RTTables::package</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">t</span><span class="plain-syntax">),</span>
<span class="plain-syntax">            </span><span class="constant-syntax">TABLE_DEFINES_TEXT_MD_HL</span><span class="plain-syntax">, </span><span class="identifier-syntax">Node::get_text</span><span class="plain-syntax">(</span><span class="identifier-syntax">t</span><span class="plain-syntax">-&gt;</span><span class="identifier-syntax">where_used_to_define</span><span class="plain-syntax">));</span>
<span class="plain-syntax">        </span><a href="2-hrr.html#SP23" class="function-link"><span class="function-syntax">Hierarchy::apply_metadata_from_number</span></a><span class="plain-syntax">(</span><a href="5-tbl.html#SP1" class="function-link"><span class="function-syntax">RTTables::package</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">t</span><span class="plain-syntax">),</span>
<span class="plain-syntax">            </span><span class="constant-syntax">TABLE_DEFINES_AT_MD_HL</span><span class="plain-syntax">,</span>
<span class="plain-syntax">            (</span><span class="identifier-syntax">inter_ti</span><span class="plain-syntax">) </span><span class="identifier-syntax">Wordings::first_wn</span><span class="plain-syntax">(</span><span class="identifier-syntax">Node::get_text</span><span class="plain-syntax">(</span><span class="identifier-syntax">t</span><span class="plain-syntax">-&gt;</span><span class="identifier-syntax">where_used_to_define</span><span class="plain-syntax">)));</span>
<span class="plain-syntax">    }</span>
</pre>
<ul class="endnotetexts"><li>This code is used in <a href="5-tbl.html#SP2">&#167;2</a>.</li></ul>
<p class="commentary firstcommentary"><a id="SP3" class="paragraph-anchor"></a><b>&#167;3. </b>The issue here is whether the value <span class="extract"><span class="extract-syntax">IMPROBABLE_VALUE</span></span> can, despite its
improbability, be valid for this kind. If we can prove that it is not, we
should return <span class="extract"><span class="extract-syntax">FALSE</span></span>; if in any doubt, we must return <span class="extract"><span class="extract-syntax">TRUE</span></span>.
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="reserved-syntax">int</span><span class="plain-syntax"> </span><span class="function-syntax">RTTables::requires_blanks_bitmap</span><button class="popup" onclick="togglePopup('usagePopup4')"><span class="comment-syntax">?</span><span class="popuptext" id="usagePopup4">Usage of <span class="code-font"><span class="function-syntax">RTTables::requires_blanks_bitmap</span></span>:<br/><a href="5-tbl.html#SP2_1_1_1_3">&#167;2.1.1.1.3</a>, <a href="5-tbl.html#SP2_2">&#167;2.2</a></span></button><span class="plain-syntax">(</span><span class="identifier-syntax">kind</span><span class="plain-syntax"> *</span><span class="identifier-syntax">K</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">K</span><span class="plain-syntax"> == </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">) </span><span class="reserved-syntax">return</span><span class="plain-syntax"> </span><span class="identifier-syntax">FALSE</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">Kinds::Behaviour::is_object</span><span class="plain-syntax">(</span><span class="identifier-syntax">K</span><span class="plain-syntax">)) </span><span class="reserved-syntax">return</span><span class="plain-syntax"> </span><span class="identifier-syntax">FALSE</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">Kinds::Behaviour::is_an_enumeration</span><span class="plain-syntax">(</span><span class="identifier-syntax">K</span><span class="plain-syntax">)) </span><span class="reserved-syntax">return</span><span class="plain-syntax"> </span><span class="identifier-syntax">FALSE</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">return</span><span class="plain-syntax"> </span><span class="identifier-syntax">TRUE</span><span class="plain-syntax">;</span>
<span class="plain-syntax">}</span>
</pre>
<p class="commentary firstcommentary"><a id="SP4" class="paragraph-anchor"></a><b>&#167;4. Compilation data for table column usages.</b>Each <span class="extract"><span class="extract-syntax">table_column_usage</span></span> object contains this data:
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="reserved-syntax">typedef</span><span class="plain-syntax"> </span><span class="reserved-syntax">struct</span><span class="plain-syntax"> </span><span class="reserved-syntax">table_column_usage_compilation_data</span><span class="plain-syntax"> {</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">struct</span><span class="plain-syntax"> </span><span class="identifier-syntax">table</span><span class="plain-syntax"> *</span><span class="identifier-syntax">owning_table</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">struct</span><span class="plain-syntax"> </span><span class="identifier-syntax">package_request</span><span class="plain-syntax"> *</span><span class="identifier-syntax">tcu_package</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">struct</span><span class="plain-syntax"> </span><span class="identifier-syntax">inter_name</span><span class="plain-syntax"> *</span><span class="identifier-syntax">tcu_iname</span><span class="plain-syntax">; </span><span class="comment-syntax"> for the array holding this at run-time</span>
<span class="plain-syntax">} </span><span class="reserved-syntax">table_column_usage_compilation_data</span><span class="plain-syntax">;</span>

<span class="reserved-syntax">table_column_usage_compilation_data</span><span class="plain-syntax"> </span><span class="function-syntax">RTTables::new_tcu_compilation_data</span><span class="plain-syntax">(</span><span class="identifier-syntax">table</span><span class="plain-syntax"> *</span><span class="identifier-syntax">t</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">table_column_usage_compilation_data</span><span class="plain-syntax"> </span><span class="identifier-syntax">tcucd</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">tcucd</span><span class="plain-syntax">.</span><span class="element-syntax">owning_table</span><span class="plain-syntax"> = </span><span class="identifier-syntax">t</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">tcucd</span><span class="plain-syntax">.</span><span class="element-syntax">tcu_package</span><span class="plain-syntax"> = </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">tcucd</span><span class="plain-syntax">.</span><span class="element-syntax">tcu_iname</span><span class="plain-syntax"> = </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">return</span><span class="plain-syntax"> </span><span class="identifier-syntax">tcucd</span><span class="plain-syntax">;</span>
<span class="plain-syntax">}</span>
</pre>
<ul class="endnotetexts"><li>The structure table_column_usage_compilation_data is private to this section.</li></ul>
<p class="commentary firstcommentary"><a id="SP5" class="paragraph-anchor"></a><b>&#167;5. </b>And each gives rise to a subpackage of the package for the table it appears in:
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="identifier-syntax">package_request</span><span class="plain-syntax"> *</span><span class="function-syntax">RTTables::tcu_package</span><button class="popup" onclick="togglePopup('usagePopup5')"><span class="comment-syntax">?</span><span class="popuptext" id="usagePopup5">Usage of <span class="code-font"><span class="function-syntax">RTTables::tcu_package</span></span>:<br/><a href="5-tbl.html#SP2_1_1_1_3">&#167;2.1.1.1.3</a>, <a href="5-tbl.html#SP2_2">&#167;2.2</a></span></button><span class="plain-syntax">(</span><span class="identifier-syntax">table_column_usage</span><span class="plain-syntax"> *</span><span class="identifier-syntax">tcu</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">tcu</span><span class="plain-syntax">-&gt;</span><span class="identifier-syntax">compilation_data</span><span class="plain-syntax">.</span><span class="element-syntax">tcu_package</span><span class="plain-syntax"> == </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">)</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">tcu</span><span class="plain-syntax">-&gt;</span><span class="identifier-syntax">compilation_data</span><span class="plain-syntax">.</span><span class="element-syntax">tcu_package</span><span class="plain-syntax"> =</span>
<span class="plain-syntax">            </span><a href="2-hrr.html#SP21" class="function-link"><span class="function-syntax">Hierarchy::package_within</span></a><span class="plain-syntax">(</span><span class="constant-syntax">TABLE_COLUMN_USAGES_HAP</span><span class="plain-syntax">,</span>
<span class="plain-syntax">                </span><a href="5-tbl.html#SP1" class="function-link"><span class="function-syntax">RTTables::package</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">tcu</span><span class="plain-syntax">-&gt;</span><span class="identifier-syntax">compilation_data</span><span class="plain-syntax">.</span><span class="element-syntax">owning_table</span><span class="plain-syntax">));</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">return</span><span class="plain-syntax"> </span><span class="identifier-syntax">tcu</span><span class="plain-syntax">-&gt;</span><span class="identifier-syntax">compilation_data</span><span class="plain-syntax">.</span><span class="element-syntax">tcu_package</span><span class="plain-syntax">;</span>
<span class="plain-syntax">}</span>

<span class="identifier-syntax">inter_name</span><span class="plain-syntax"> *</span><span class="function-syntax">RTTables::tcu_iname</span><button class="popup" onclick="togglePopup('usagePopup6')"><span class="comment-syntax">?</span><span class="popuptext" id="usagePopup6">Usage of <span class="code-font"><span class="function-syntax">RTTables::tcu_iname</span></span>:<br/><a href="5-tbl.html#SP2_1_1">&#167;2.1.1</a>, <a href="5-tbl.html#SP2_1_1_1">&#167;2.1.1.1</a></span></button><span class="plain-syntax">(</span><span class="identifier-syntax">table_column_usage</span><span class="plain-syntax"> *</span><span class="identifier-syntax">tcu</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">tcu</span><span class="plain-syntax">-&gt;</span><span class="identifier-syntax">compilation_data</span><span class="plain-syntax">.</span><span class="element-syntax">tcu_iname</span><span class="plain-syntax"> == </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">)</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">tcu</span><span class="plain-syntax">-&gt;</span><span class="identifier-syntax">compilation_data</span><span class="plain-syntax">.</span><span class="element-syntax">tcu_iname</span><span class="plain-syntax"> =</span>
<span class="plain-syntax">            </span><a href="2-hrr.html#SP12" class="function-link"><span class="function-syntax">Hierarchy::make_iname_in</span></a><span class="plain-syntax">(</span><span class="constant-syntax">COLUMN_DATA_HL</span><span class="plain-syntax">, </span><a href="5-tbl.html#SP5" class="function-link"><span class="function-syntax">RTTables::tcu_package</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">tcu</span><span class="plain-syntax">));</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">return</span><span class="plain-syntax"> </span><span class="identifier-syntax">tcu</span><span class="plain-syntax">-&gt;</span><span class="identifier-syntax">compilation_data</span><span class="plain-syntax">.</span><span class="element-syntax">tcu_iname</span><span class="plain-syntax">;</span>
<span class="plain-syntax">}</span>
</pre>
<p class="commentary firstcommentary"><a id="SP6" class="paragraph-anchor"></a><b>&#167;6. Kinds as tables.</b></p>

<pre class="displayed-code all-displayed-code code-font">
<span class="identifier-syntax">table</span><span class="plain-syntax"> *</span><span class="function-syntax">RTTables::table_defining_this</span><span class="plain-syntax">(</span><span class="identifier-syntax">kind</span><span class="plain-syntax"> *</span><span class="identifier-syntax">K</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">K</span><span class="plain-syntax"> == </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">) </span><span class="reserved-syntax">return</span><span class="plain-syntax"> </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">return</span><span class="plain-syntax"> </span><span class="identifier-syntax">K</span><span class="plain-syntax">-&gt;</span><span class="identifier-syntax">construct</span><span class="plain-syntax">-&gt;</span><span class="identifier-syntax">named_values_created_with_table</span><span class="plain-syntax">;</span>
<span class="plain-syntax">}</span>

<span class="reserved-syntax">void</span><span class="plain-syntax"> </span><span class="function-syntax">RTTables::defines</span><span class="plain-syntax">(</span><span class="identifier-syntax">table</span><span class="plain-syntax"> *</span><span class="identifier-syntax">t</span><span class="plain-syntax">, </span><span class="identifier-syntax">kind</span><span class="plain-syntax"> *</span><span class="identifier-syntax">K</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">K</span><span class="plain-syntax"> == </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">) </span><span class="identifier-syntax">internal_error</span><span class="plain-syntax">(</span><span class="string-syntax">"no such kind"</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">K</span><span class="plain-syntax">-&gt;</span><span class="identifier-syntax">construct</span><span class="plain-syntax">-&gt;</span><span class="identifier-syntax">named_values_created_with_table</span><span class="plain-syntax"> = </span><span class="identifier-syntax">t</span><span class="plain-syntax">;</span>
<span class="plain-syntax">}</span>
</pre>
<nav role="progress"><div class="progresscontainer">
    <ul class="progressbar"><li class="progressprev"><a href="5-mlt.html">&#10094;</a></li><li class="progresschapter"><a href="P-wtmd.html">P</a></li><li class="progresschapter"><a href="1-rm.html">1</a></li><li class="progresschapter"><a href="2-hrr.html">2</a></li><li class="progresschapter"><a href="3-gm.html">3</a></li><li class="progresschapter"><a href="4-enc.html">4</a></li><li class="progresscurrentchapter">5</li><li class="progresssection"><a href="5-act.html">act</a></li><li class="progresssection"><a href="5-adj.html">adj</a></li><li class="progresssection"><a href="5-chr.html">chr</a></li><li class="progresssection"><a href="5-cnj.html">cnj</a></li><li class="progresssection"><a href="5-eqt.html">eqt</a></li><li class="progresssection"><a href="5-ins.html">ins</a></li><li class="progresssection"><a href="5-bi.html">bi</a></li><li class="progresssection"><a href="5-di.html">di</a></li><li class="progresssection"><a href="5-ri.html">ri</a></li><li class="progresssection"><a href="5-si.html">si</a></li><li class="progresssection"><a href="5-mlt.html">mlt</a></li><li class="progresscurrent">tbl</li><li class="progresssection"><a href="5-tc.html">tc</a></li><li class="progresssection"><a href="5-dbi.html">dbi</a></li><li class="progresssection"><a href="5-dli.html">dli</a></li><li class="progresssection"><a href="5-dci.html">dci</a></li><li class="progresssection"><a href="5-rls.html">rls</a></li><li class="progresssection"><a href="5-rlb.html">rlb</a></li><li class="progresssection"><a href="5-vrb.html">vrb</a></li><li class="progresssection"><a href="5-prp.html">prp</a></li><li class="progresssection"><a href="5-rlt.html">rlt</a></li><li class="progresssection"><a href="5-lp.html">lp</a></li><li class="progresssection"><a href="5-kc.html">kc</a></li><li class="progresssection"><a href="5-ki.html">ki</a></li><li class="progresssection"><a href="5-act2.html">act2</a></li><li class="progresssection"><a href="5-nap.html">nap</a></li><li class="progresssection"><a href="5-ts.html">ts</a></li><li class="progresschapter"><a href="6-bd.html">6</a></li><li class="progresschapter"><a href="7-cg.html">7</a></li><li class="progressnext"><a href="5-tc.html">&#10095;</a></li></ul></div>
</nav><!-- End of weave -->

		</main>
	</body>
</html>

